﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta charset="utf-8">
    <title>btable</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/btable.css" />
	<link href="css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
    <script src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
    $(document).ready(function() {
		var url = "<%=request.getContextPath()%>/selectding.do";
		$.post(
			//路径
			url,
			$("form").serialize(),
			//回调函数
			function(data) {
				if(data=="0"){
					alert("你未租赁汽车无需归还！");
				}else {
					var url = "<%=request.getContextPath()%>/selecthuanche.do";
					$.post(
							//路径
							url,
							$("form").serialize(),
							//回调函数
							function(data) {
								for ( var i=0;i<data.length;i++) {
									$("#unamename").val(data[i].unamename);
									$("#cname").val(data[i].cname);
									$("#ccard").val(data[i].ccard);
									$("#cmoney").val(data[i].cmoney);
									$("#omoney").val(data[i].omoney);
									$("#otime").val(data[i].otime);;
								}
							},
							//返回类型
							"json"
						); 
				}
			},
			//返回类型
			"json"
		);
	});
    
    function fang() {
    	var url = "<%=request.getContextPath()%>/huanche.do";
		$.post(
			//路径
			url,
			//回调函数
			function(data1) {		
				alert("还车成功，如果你超出约定时间还车，超出时间不足一天，按一天收费,"
						+"并附带30元的的惩罚，详情请查看个人订单或首页的租车规则");
			},
			//返回类型
			"json"
		);
		alert("还车成功，如果你超出约定时间还车，超出时间不足一天，按一天收费,"
				+"并附带30元的的惩罚，详情请查看个人订单或首页的租车规则");
	}
    </script>
</head>

<body style=" background-color: gainsboro;">

    <div style="margin:0px; background-color: white; margin:0 10px;">
        <div id="content" style="width: 100%;height: 533px;">
			<!-- 搭建显示页面 -->
		<div class="container">
	
		<div class="row">
			<h1 align="center">还车订单</h1>
		</div>
		<!-- 显示表格数据 -->
		<div class="row">
			<div class="col-md-12">
				<form action="" method="post">
				<table class="table table-hover">
					<tr>
						<td>用户名：</td><!-- readonly="readonly" disabled="disabled" -->
						<td><input type="text" id="unamename" readonly="readonly"  name="unamename" value=""/></td>
					</tr>
					<tr>	
						<td>车辆名称：</td>
						<td><input type="text" id="cname" readonly="readonly" name="cname" value=""/></td>
					</tr>
					<tr>
						<td>车牌号：</td>
						<td>
							<input type="text" id="ccard" readonly="readonly" name="ccard" value=""/>
						</td>
					</tr>
					<tr>
						<td>收费标准（/天）：</td>
						<td><input type="text" id="cmoney" readonly="readonly" name="cmoney" value=""/></td>
					</tr>
					<tr>
						<td>约定租车时间:</td>
						<td><input type="text" id="otime" readonly="readonly" name="otime" value=""/></td>
					</tr>
					<tr>
						<td>约定费用：</td>
						<td><input type="text" id="omoney" readonly="readonly" name="omoney" value=""/></td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<button class="btn btn-primary btn-sm" onclick="fang()">提交</button>
						</td>
					</tr>
				</table>
				</form>
			</div>
		</div>
        </div>
		</div>
    </div>
	
</body>

</html>